//
//  UUCharterSupplierTests.m
//  UUCharterSupplierTests
//
//  Created by ZhangAo on 10/01/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import <XCTest/XCTest.h>

#import <UUFoundation/UUFileManager.h>
#import <UUFoundation/DKDataManager.h>
#import "UUIntentOrderManager.h"

@interface UUCharterSupplierTests : XCTestCase

@end

@implementation UUCharterSupplierTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
    
    [[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantFuture]];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

- (void)testUpload {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"iconfont" ofType:@"ttf"];
    DKFileUploadBaseTask *task = [GetFileManager() uploadPathTask:path];
    [GetFileManager() startFileTask:task progressBlock:nil completeBlock:nil];
}

- (void)testIntentOrders {
    [GetIntentOrderManager() asyncFetchIntentOrdersWithSince:nil length:20 completeBlock:^(NSArray<UUIntentOrderModel *> *orders, id since, NSError *error) {
        
    }];
}

- (void)testUpdateCitiesDB {
    UUCityRequestModel *requestModel = [UUCityRequestModel new];
    [[DKDataManager new] requestWithRequestModel:requestModel completedBlock:^(DKResponseModel *responseModel, NSError *error) {
        [UUCityModel insertArrayByAsyncToDB:[responseModel data]];
    }];
}

- (void)testLocation {
    [GetLocationManager() asyncFetchCurrentLocationWithCache:NO completeBlock:^(UULocationModel *location, NSError *error) {
        NSLog(@"%@", error);
    }];
}

@end
